<template>
  <uni-section title="下达列表" titleFontSize="35rpx" type="line">
    <uni-list>
      <uni-list-item v-for="item in fkxxList" :title="item.sxbt" :note="item.xdrq" showArrow
                     thumb="https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/unicloudlogo.png" thumb-size="lg" rightText="查看"
                     ellipsis="2" :to="`./ckRwxx?fkId=${item.sid}&workid=${item.workid}&ly=${item.ly}`" @click="onClick"/>
    </uni-list>
    <template v-slot:right>
      <view class="action-btn">
        <button @click="getFkls()" class="login-btn cu-btn  uni-success">查看一键反馈</button>
      </view>
    </template>
  </uni-section>
</template>

<script>
import {	getFkxxByUserId	} from "@/api/system/yjgl";
import { getUserId} from '@/utils/auth';
export default {
  name: "index",
  data() {
    return {
      fkxxList: [],
      type: 'yfk',
    };
  },
  onLoad() {
    this.getList(getUserId());
  },
  methods: {
    getFkls(){
      uni.navigateTo({
        url: '/pages/index-bak' // 假设你要跳转的页面路径为/pages/target/target
      });
    },
    getUrlParam(url){
      const paramsRegex = /[?&]+([^=&]+)=([^&]*)/gi;
      const params = {};
      let match;
      while (match = paramsRegex.exec(url)) {
        params[match[1]] = match[2];
      }
      return params;
    },
    //访问微信地址，用来获取code
    getWeChatCode() {
      //通过微信官方接口获取code之后，会重新刷新设置的回调地址【redirect_uri】
      let redirect_uri = encodeURIComponent(window.location.href)
      window.location.href = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww7555960e312add1f&redirect_uri="+redirect_uri+"&response_type=code&scope=snsapi_base&state=STATE&agentid=AGENTID#wechat_redirect"
    },
    // 企业微信登录
    async wxLogin(code) {
      this.$modal.loading("登录中，请耐心等待...")
      this.$store.dispatch('WxLogin', code).then(() => {
        this.$modal.closeLoading()
      })
    },
    onClick(e) {
    },
    getList(userId) {
      getFkxxByUserId({userId,'type':this.type}).then(res => {
        this.fkxxList = res.data
      })
    }
  }
}
</script>

<style>
page {
  background-color: #f5f6f7;
}
</style>
